home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Oct 19, 1998
- //<doc>
- //<name objectLayer>
- //<owner "Alias|Wavefront Unsupported">
- //<synopsis>
- // string objectLayer( string )
- //<keywords>
- // DAG displayLayer layer member
- //
- //<description>
- // All eligible objects (ie. DAG objects) must be in exactly one layer.
- // This script returns the layer to which the given object belongs.
- //
- //<flags>
- // string $object
- // The name of the object who's layer is to be found.
- //
- //<examples>
- // // Create an object, which will automatically go into the defaultLayer
- // createNode transform -n father;
- // objectLayer father;
- // // Result : defaultLayer //
- //
- // // Put the object into a layer and verify membership
- // createDisplayLayer -e -n fatherLayer;
- // editDisplayLayerMembers fatherLayer father;
- // objectLayer father;
- // // Result : fatherLayer //
- //
- // // The time node is not a DAG node and so has no layer
- // objectLayer time1;
- //
- // // The above blank line indicates that there was no return value
- //
- //<returns>
- // string: The layer the object belongs to. NULL if the object is
- // not eligible for layer membership.
- //</doc>
- //
-
- global proc string objectLayer(string $object)
- {
- // First determine that the object is a legal layer member.
- string $drawOvr = ($object + ".drawOverride");
- if( ! `objExists $drawOvr` )
- {
- return "";
- }
-
- // Now look across the draw override connection to find the layer it
- // belongs to.
- string $connList[] = `listConnections -t displayLayer -d false $drawOvr`;
- if( size($connList) == 1 )
- {
- return $connList[0];
- }
- return "defaultLayer";
- }
-